import request from '@/utils/request'
import { CHECC_API_CMS } from '@/constants/proxy'
import { exportMethod } from '@/utils/utils'

const getProductList = (params) => {
  return request.post(
    CHECC_API_CMS +
      `/xmzx/scheduleContractPlan/getProductList?current=${params.current}&size=${params.size}&projectName=${params.projectName}`
  )
}
const terminate = (params: any = {}) => {
  return request.post(CHECC_API_CMS + `/xmzx/acceptanceProject/update`, params)
}
const acceptanceProjects = (params: any = {}) => {
  return request.post(CHECC_API_CMS + `/xmzx/scheduleContractPlan/audit`, params)
}
const acceptanceSave = (params: any = {}) => {
  return request.post(CHECC_API_CMS + `/xmzx/scheduleContractPlan/update`, params)
}
const getDetail = (id) => {
  return request.post(CHECC_API_CMS + `/xmzx/scheduleContractPlan/getProductDetail?id=` + id)
}
//导出
export function getExportExcel(data) {
  const params = {
    method: 'post',
    url: CHECC_API_CMS + '/xmzx/scheduleContractPlan/export',
    fileName: '进度执行列表',
    data: data,
  }
  console.log(data)
  return exportMethod(params)
}
export { getProductList, terminate, acceptanceProjects, getDetail, acceptanceSave }
